﻿
@{
    Layout = null;
}
<style>
    .clearfix:after {
        content: ".";
        display: block;
        height: 0;
        clear: both;
        visibility: hidden;
    }

    .clearfix {
        *+height:1%;
    }

    .new_aBox {
        width: 100%;
        display: block;
    }

    .new_btns {
        text-align: right;
        margin-top: 5px;
    }

    .new_tkBtn {
        padding: 3px 5px;
        min-width: 70px;
        border: 1px solid #dcdcdc;
        border-radius: 20px;
        font-size: 12px;
        color: #444444;
        float: right;
        text-align: center;
    }

    .w_odt_procon {
        border-bottom: 1px solid #f5f5f5;
    }
    .w_odt_procon62{position:relative;}
		.w_odt_procon62 .w_odtpro_name{margin-right:45px;}
		.w_state62{position:absolute; right:10px; top:10px; font-size:12px; color:#ff4949;}
</style>
<div class="w_oderDetail" ng-controller="OrderDetailController">
    <div class="w_odetil_top">
        <div class="w_odtltp_left">
            <div style="margin-top: 10px">{{Model.OrderStatusDes}}</div>

        </div>

    </div>
    <div class="w_odt_info">
        <div class="w_odtInfo_a">
            <span>{{Model.ReceiveName}}</span>
            <label>{{Model.ReceivePhone}}</label>
        </div>
        <p class="w_odtInfo_b">{{Model.Province}}{{Model.City}}{{Model.Area}}{{Model.ReceiveAddress}}</p>

    </div>
    <div class="w_odt_pro">
        <div class="w_odt_proti">优品三悦</div>
        <div class="w_odt_procon w_odt_procon62" ng-repeat="item in Model.V_OrderDetailList">
            <a class="new_aBox clearfix">
                <p class="w_state62">{{item.SendStatusDes}}</p>
                <div class="w_odtpro_conleft"><img src="{{ImgHostUrl+item.ImgUrl}}" /></div>
                <div class="w_odtpro_conright">
                    <div class="w_odtpro_name">{{item.ProductName}}</div>
                    <p class="w_odtpro_more">
                        <span>实付款：¥{{item.DiscountPrice}}</span>
                        <label>X{{item.ProductCount}}</label>
                    </p>
                </div>
            </a>
            <div class="new_btns clearfix" ng-show="item.IsAllowReturn" ng-click="$state.go('shop.return',{id:item.Id})"><a class="new_tkBtn">申请退货</a></div>
            <div class="new_btns clearfix" ng-show="item.SendStatus==1" ><a href="javascript:void(0)" ng-click="confirmOrder(item.Id,item)" class="new_tkBtn">确认收货</a></div>
</div>
        <div class="to_share clearfix"><div class="btn" ng-show="Model.OrderType==2" ng-click="goshare(Model1.GroupHeadID)">去分享</div></div>
    </div>
    <div class="w_ordtl_payInfo">
        <div class="w_ordtl_payTi">支付信息</div>
        <p class="w_ordtl_payCon">
            <span>订单号</span>
            <label>{{Model.OrderNo}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>下单时间</span>
            <label>{{Model.AddTime}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>付款方式</span>
            <label>{{Model.PayTypeDes}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>订单金额</span>
            <label>¥{{Model.ProductPrice}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>优惠券</span>
            <label>¥{{Model.ActivityCouponMoney}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>积分抵扣</span>
            <label>¥{{Model.PointsPayMoney}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>邮费</span>
            <label>¥{{Model.PostageMoney}}</label>
        </p>
        <p class="w_ordtl_payCon">
            <span>实付款</span>
            <label>¥{{Model.MemberMoney+Model.PayMoney}}</label>
        </p>
    </div>
    <div class="w_wlstate" ng-show="Model.DeliveryList!=null&&Model.DeliveryList.length>0">
        <div class="w_wlstate_ti">物流状态</div>
        <div class="w_wlstate_con" ng-repeat="item in Model.DeliveryList">
            <div>运 单 号:     {{item.InvoiceNo}} </div>
            <p ng-click="golook(item.InvoiceNo)"><a>查看物流</a></p>
        </div>
    </div>
</div>
<script>
    App.controller('OrderDetailController', [
                '$scope', '$state', '$route', '$rootScope', '$http', '$stateParams',
                    function ($scope, $state, $route,$rootScope, $http, $stateParams) {
                        $scope.Model = {};
                        $http.post("/Order/GetOrderInfo", { id: $stateParams.id }).then(function (response) {
                            if (response.data.isSuccess) {
                                $scope.Model = angular.copy(response.data.data);
                                if ($scope.Model.OrderType == 2) {
                                    $scope.Model1 = angular.copy(response.data.data2);
                                }
                            }

                        });
                        var tt = function ()
                        {
                            $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);
                        }

                        setTimeout(tt, 1000)
                        $scope.golook = function (id) {
                            location.href = "http://m.kuaidi100.com/index_all.html?postid=" + id;
                        }

                        $scope.goshare = function (id) {
                            $state.go('activity.groupheadinfo', { "Id": id });
                        }


                        $scope.confirmOrder = function (id,item) {
                            layer.confirm('确认收货吗？', {
                                btn: ['确定', '取消'] //按钮
                            }, function () {
                                layer.load(2);
                                $http.post("/Order/GoodsReceipt", { id: id }).then(function (response) {
                                    layer.closeAll('loading');
                                    if (response.data.isSuccess) {
                                        layer.msg("操作成功");
                                        item.SendStatus = 4;
                                    }
                                    else {

                                        layer.msg(response.data.msg);
                                    }

                                });
                            }, function () {

                            });
                        }

                    }
    ]);
</script>